from django.urls import path, re_path
from django.contrib.auth.decorators import login_required
from .views import *


urlpatterns = [
    re_path('^register/$', RegisterView.as_view()),
    re_path('^usernames/(?P<username>[a-zA-Z0-9_]{5,8})/count/$', UsernameCount.as_view()),
    re_path('^phones/(?P<phone>1[3-9][0-9]{9})/count/$', PhoneCount.as_view()),
    re_path('^login/$', LoginView.as_view(), name='login'),
    re_path('^logout/$', LogoutView.as_view(), name='logout'),
    re_path('^usercenter/$', login_required(UserCenterView.as_view()), name='user_center'),
    re_path('^emails/$', EmailView.as_view()),
]
